package opl.utilities;

import android.content.Context;
import android.net.ConnectivityManager;
import android.util.Log;

public class NetworkHelper {

	public static boolean isInternetAvailable(Context context ) {
	    ConnectivityManager cm = (ConnectivityManager) context.getSystemService(Context.CONNECTIVITY_SERVICE);
	    // test for connection
	    if (cm.getActiveNetworkInfo() != null
	            && cm.getActiveNetworkInfo().isAvailable()
	            && cm.getActiveNetworkInfo().isConnected()) {
	        return true;
	    } else {
	        Log.v("Internet", "Internet Connection Not Present");
	        return false;
	    }
	}
}
